/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.compassion.entidades;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/** Clase entidad para el mapeo de tabla de base de datos Aula
* @author grupo de Tesis
*/
@Entity
@Table(name = "aula")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Aula.findAll", query = "SELECT a FROM Aula a"),
    @NamedQuery(name = "Aula.findByIdAula", query = "SELECT a FROM Aula a WHERE a.idAula = :idAula"),
    @NamedQuery(name = "Aula.findByNomAula", query = "SELECT a FROM Aula a WHERE a.nomAula = :nomAula"),
    @NamedQuery(name = "Aula.findByCapAula", query = "SELECT a FROM Aula a WHERE a.capAula = :capAula"),
    @NamedQuery(name = "Aula.findByDesAula", query = "SELECT a FROM Aula a WHERE a.desAula = :desAula"),
    @NamedQuery(name = "Aula.findByEstAula", query = "SELECT a FROM Aula a WHERE a.estAula = :estAula"),
    @NamedQuery(name = "Aula.findByAuAddUsr", query = "SELECT a FROM Aula a WHERE a.auAddUsr = :auAddUsr"),
    @NamedQuery(name = "Aula.findByAuAddDat", query = "SELECT a FROM Aula a WHERE a.auAddDat = :auAddDat"),
    @NamedQuery(name = "Aula.findByAuModUsr", query = "SELECT a FROM Aula a WHERE a.auModUsr = :auModUsr"),
    @NamedQuery(name = "Aula.findByAuModDat", query = "SELECT a FROM Aula a WHERE a.auModDat = :auModDat")})
public class Aula implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idAula")
    private Integer idAula;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "nomAula")
    private String nomAula;
    @Basic(optional = false)
    @NotNull
    @Column(name = "capAula")
    private int capAula;
    @Size(max = 100)
    @Column(name = "desAula")
    private String desAula;
    @Basic(optional = false)
    @NotNull
    @Column(name = "estAula")
    private int estAula;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddUsr")
    private int auAddUsr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddDat")
    @Temporal(TemporalType.DATE)
    private Date auAddDat;
    @Column(name = "AuModUsr")
    private Integer auModUsr;
    @Column(name = "AuModDat")
    @Temporal(TemporalType.DATE)
    private Date auModDat;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idAula")
    private Collection<Actividad> actividadCollection;
    @JoinColumn(name = "idCdi", referencedColumnName = "idCdi")
    @ManyToOne(optional = false)
    private Cdi idCdi;

    public Aula() {
    }

    public Aula(Integer idAula) {
        this.idAula = idAula;
    }

    public Aula(Integer idAula, String nomAula, int capAula, int estAula, int auAddUsr, Date auAddDat) {
        this.idAula = idAula;
        this.nomAula = nomAula;
        this.capAula = capAula;
        this.estAula = estAula;
        this.auAddUsr = auAddUsr;
        this.auAddDat = auAddDat;
    }

    public Integer getIdAula() {
        return idAula;
    }

    public void setIdAula(Integer idAula) {
        this.idAula = idAula;
    }

    public String getNomAula() {
        return nomAula;
    }

    public void setNomAula(String nomAula) {
        this.nomAula = nomAula;
    }

    public int getCapAula() {
        return capAula;
    }

    public void setCapAula(int capAula) {
        this.capAula = capAula;
    }

    public String getDesAula() {
        return desAula;
    }

    public void setDesAula(String desAula) {
        this.desAula = desAula;
    }

    public int getEstAula() {
        return estAula;
    }

    public void setEstAula(int estAula) {
        this.estAula = estAula;
    }

    public int getAuAddUsr() {
        return auAddUsr;
    }

    public void setAuAddUsr(int auAddUsr) {
        this.auAddUsr = auAddUsr;
    }

    public Date getAuAddDat() {
        return auAddDat;
    }

    public void setAuAddDat(Date auAddDat) {
        this.auAddDat = auAddDat;
    }

    public Integer getAuModUsr() {
        return auModUsr;
    }

    public void setAuModUsr(Integer auModUsr) {
        this.auModUsr = auModUsr;
    }

    public Date getAuModDat() {
        return auModDat;
    }

    public void setAuModDat(Date auModDat) {
        this.auModDat = auModDat;
    }

    @XmlTransient
    public Collection<Actividad> getActividadCollection() {
        return actividadCollection;
    }

    public void setActividadCollection(Collection<Actividad> actividadCollection) {
        this.actividadCollection = actividadCollection;
    }

    public Cdi getIdCdi() {
        return idCdi;
    }

    public void setIdCdi(Cdi idCdi) {
        this.idCdi = idCdi;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAula != null ? idAula.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Aula)) {
            return false;
        }
        Aula other = (Aula) object;
        if ((this.idAula == null && other.idAula != null) || (this.idAula != null && !this.idAula.equals(other.idAula))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.compassion.entidades.Aula[ idAula=" + idAula + " ]";
    }
    
}
